package org.gov.vis.master.gui;
import java.awt.Frame;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;

import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextField;

import org.gov.vis.gui.VisBaseDialog;
import org.gov.vis.gui.util.GuiUtil;
import org.gov.vis.master.gui.listener.ViewGopalaMithraListener;

public class ViewGopalaMithraDialog extends VisBaseDialog{/*

 *//**
 * 
 *//*
	private static final long serialVersionUID = 167971492119959526L;
	private JTextField codeTxtBx;
	private JPanel pnlGopMitSrchResults;
	private JScrollPane scrlPnGopMitSrcResults;
	private JPanel outerSrchPnl;
	private JButton searchBtn;
	private JLabel codeLbl;
	private JPanel searchPnl;
	private JPanel viewGopalaMithraMainPnl;

	public ViewGopalaMithraDialog(Frame owner, String title, boolean modal) {
		super(owner, title, modal);
		// TODO Auto-generated constructor stub

		GridBagLayout thisLayout = new GridBagLayout();
		thisLayout.rowWeights = new double[] {0.1};
		thisLayout.rowHeights = new int[] {7};
		thisLayout.columnWeights = new double[] {0.1};
		thisLayout.columnWidths = new int[] {7};
		getContentPane().setLayout(thisLayout);
		this.setSize(700, 500);
		{
			viewGopalaMithraMainPnl = new JPanel();
			GridBagLayout viewGopalaMithraMainPnlLayout = new GridBagLayout();
			getContentPane().add(viewGopalaMithraMainPnl, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
			viewGopalaMithraMainPnlLayout.rowWeights = new double[] {0.0, 0.0, 0.0, 0.1, 0.0};
			viewGopalaMithraMainPnlLayout.rowHeights = new int[] {7, 7, 20, 7, 7};
			viewGopalaMithraMainPnlLayout.columnWeights = new double[] {0.0, 0.1, 0.0};
			viewGopalaMithraMainPnlLayout.columnWidths = new int[] {7, 7, 7};
			viewGopalaMithraMainPnl.setLayout(viewGopalaMithraMainPnlLayout);
			{
				searchPnl = new JPanel();
				GridBagLayout searchPnlLayout = new GridBagLayout();
				searchPnlLayout.rowWeights = new double[] {0.0, 0.1, 0.0};
				searchPnlLayout.rowHeights = new int[] {7, 7, 7};
				searchPnlLayout.columnWeights = new double[] {0.0, 0.0, 0.0, 0.1, 0.0, 0.1, 0.0};
				searchPnlLayout.columnWidths = new int[] {20, 7, 7, 7, 20, 20, 7};
				searchPnl.setLayout(searchPnlLayout);
				viewGopalaMithraMainPnl.add(getSearchPnl(), new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
				searchPnl.setBorder(BorderFactory.createTitledBorder("Search GopalaMithra"));
				{
					codeLbl = new JLabel();
					searchPnl.add(codeLbl, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.VERTICAL, new Insets(0, 0, 0, 0), 0, 0));
					codeLbl.setText("Code :");
				}
				{
					codeTxtBx = new JTextField();
					searchPnl.add(codeTxtBx, new GridBagConstraints(3, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
				}
				{
					searchBtn = new JButton();
					searchPnl.add(searchBtn, new GridBagConstraints(5, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.VERTICAL, new Insets(0, 0, 0, 0), 0, 0));
					searchBtn.setText("Search");
				}
			}
			{
				outerSrchPnl = new JPanel();
				GridBagLayout outerSrchPnlLayout = new GridBagLayout();
				viewGopalaMithraMainPnl.add(outerSrchPnl, new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
				outerSrchPnlLayout.rowWeights = new double[] {0.1, 0.0};
				outerSrchPnlLayout.rowHeights = new int[] {7, 7};
				outerSrchPnlLayout.columnWeights = new double[] {0.0, 0.1, 0.0};
				outerSrchPnlLayout.columnWidths = new int[] {7, 7, 7};
				outerSrchPnl.setLayout(outerSrchPnlLayout);
				outerSrchPnl.setBorder(BorderFactory.createTitledBorder("Search Results"));
				{
					scrlPnGopMitSrcResults = new JScrollPane();
					outerSrchPnl.add(scrlPnGopMitSrcResults, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
					{
						pnlGopMitSrchResults = new JPanel();
						scrlPnGopMitSrcResults.setViewportView(pnlGopMitSrchResults);
						//scrlPnGopMitSrcResults.setBorder(BorderFactory.createTitledBorder("Scroll Pane Results"));
						GridBagLayout pnlGopMitSrchResultsLayout = new GridBagLayout();
						pnlGopMitSrchResultsLayout.rowWeights = new double[] {0.0, 0.1};
						pnlGopMitSrchResultsLayout.rowHeights = new int[] {7, 20};
						pnlGopMitSrchResultsLayout.columnWeights = new double[] {0.1};
						pnlGopMitSrchResultsLayout.columnWidths = new int[] {7};
						pnlGopMitSrchResults.setLayout(pnlGopMitSrchResultsLayout);
					}
				}
			}
		}

		createDummySearcResults();
	}

	private void createDummySearcResults() {

		List<GopalaMithraDto> lstGplMit = VISDataGrid.getGpalMithra();
		List<String> colLst = VISDataGrid.getColLst();

		ArrayList<Object> dataList = new ArrayList<Object>(1);
		if(lstGplMit != null && !lstGplMit.isEmpty()){
			for(GopalaMithraDto dto:lstGplMit){
				ArrayList<Object> lst = new ArrayList<Object>(1);
				//setting each property of the current Accessory object (row) to the list
				lst.add(dto);
				lst.add(dto.getGplMthId());
				lst.add(dto.getCode());
				lst.add(dto.getName());
				lst.add(dto.getDistrict());
				dataList.add(lst);
			}//end for 
		}//end if
		VISDataGrid.createDataPanel(dataList, colLst, pnlGopMitSrchResults, new ViewGopalaMithraListener());

	}

	public JPanel getSearchPnl() {
		return searchPnl;
	}

  */



	/**
	 * 
	 */
	private static final long serialVersionUID = 3037592139958515222L;

	private JPanel viewGopalaMithraPanel;
	private JPanel searchPnl;
	private JLabel codeLbl;
	private JTextField codeTxtBx;
	private JButton searchBtn;
	private JPanel outerSrchPnl;
	private JScrollPane scrlPnGopalaMithraResults;
	private JPanel pnlGopalaMithraResults;

	public ViewGopalaMithraDialog(Frame owner, String title, boolean modal) {
		super(owner, title, modal);
		initGUI();
		GuiUtil.CompCenterCords cords=GuiUtil.getCompCenterCords(700, 500);
		setBounds(cords.getX(), cords.getY(), 700, 500);	
		this.setSize(700,500);
	}

	public JPanel getPnlGopalaMithraResults() {
		return pnlGopalaMithraResults;
	}

	private void initGUI() {
		try {
			{

				GridBagLayout thisLayout = new GridBagLayout();
				thisLayout.rowWeights = new double[] {0.1};
				thisLayout.rowHeights = new int[] {7};
				thisLayout.columnWeights = new double[] {0.1};
				thisLayout.columnWidths = new int[] {7};
				getContentPane().setLayout(thisLayout);
				this.setSize(700, 500);
			}
			{
				viewGopalaMithraPanel = new JPanel();
				GridBagLayout viewGopalaMithraMainPnlLayout = new GridBagLayout();
				getContentPane().add(viewGopalaMithraPanel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
				viewGopalaMithraMainPnlLayout.rowWeights = new double[] {0.0, 0.0, 0.0, 0.1, 0.0};
				viewGopalaMithraMainPnlLayout.rowHeights = new int[] {7, 7, 7, 7, 7};
				viewGopalaMithraMainPnlLayout.columnWeights = new double[] {0.0, 0.1, 0.0};
				viewGopalaMithraMainPnlLayout.columnWidths = new int[] {7, 7, 7};
				viewGopalaMithraPanel.setLayout(viewGopalaMithraMainPnlLayout);

				{
					{
						searchPnl = new JPanel();
						GridBagLayout searchPnlLayout = new GridBagLayout();
						searchPnlLayout.rowWeights = new double[] {0.0, 0.1, 0.0};
						searchPnlLayout.rowHeights = new int[] {7, 7, 7};
						searchPnlLayout.columnWeights = new double[] {0.0, 0.0, 0.0, 0.1, 0.0, 0.1, 0.0};
						searchPnlLayout.columnWidths = new int[] {20, 7, 7, 7, 20, 20, 7};
						searchPnl.setLayout(searchPnlLayout);
						viewGopalaMithraPanel.add(getSearchPnl(), new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
						searchPnl.setBorder(BorderFactory.createTitledBorder("Search GopalaMithra"));
						{
							codeLbl = new JLabel();
							searchPnl.add(codeLbl, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.VERTICAL, new Insets(0, 0, 0, 0), 0, 0));
							codeLbl.setText("Code :");
						}
						{
							codeTxtBx = new JTextField();
							searchPnl.add(codeTxtBx, new GridBagConstraints(3, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
						}
						{
							searchBtn = new JButton();
							searchPnl.add(searchBtn, new GridBagConstraints(5, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.VERTICAL, new Insets(0, 0, 0, 0), 0, 0));
							searchBtn.setText("Search");
							searchBtn.addActionListener(new ViewGopalaMithraListener(this));
						}
					}
				}

				{
					outerSrchPnl = new JPanel();
					GridBagLayout outerSrchPnlLayout = new GridBagLayout();
					viewGopalaMithraPanel.add(outerSrchPnl, new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
					outerSrchPnlLayout.rowWeights = new double[] {0.1, 0.0};
					outerSrchPnlLayout.rowHeights = new int[] {7, 7};
					outerSrchPnlLayout.columnWeights = new double[] {0.0, 0.1, 0.0};
					outerSrchPnlLayout.columnWidths = new int[] {7, 7, 7};
					outerSrchPnl.setLayout(outerSrchPnlLayout);
					outerSrchPnl.setBorder(BorderFactory.createTitledBorder("Search Results"));
					{
						scrlPnGopalaMithraResults = new JScrollPane();
						outerSrchPnl.add(scrlPnGopalaMithraResults, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
						{
							pnlGopalaMithraResults = new JPanel();
							scrlPnGopalaMithraResults.setViewportView(pnlGopalaMithraResults);
							//scrlPnGopMitSrcResults.setBorder(BorderFactory.createTitledBorder("Scroll Pane Results"));
							GridBagLayout pnlGopMitSrchResultsLayout = new GridBagLayout();
							pnlGopMitSrchResultsLayout.rowWeights = new double[] {0.0, 0.1};
							pnlGopMitSrchResultsLayout.rowHeights = new int[] {7, 20};
							pnlGopMitSrchResultsLayout.columnWeights = new double[] {0.1};
							pnlGopMitSrchResultsLayout.columnWidths = new int[] {7};
							pnlGopalaMithraResults.setLayout(pnlGopMitSrchResultsLayout);
						}
					}
				}


			}



		} catch(Exception e) {
			e.printStackTrace();
		}
	}

	public JPanel getSearchPnl() {
		return searchPnl;
	}

	public JLabel getCodeLbl() {
		return codeLbl;
	}

	public JTextField getCodeTxtBx() {
		return codeTxtBx;
	}

	public JButton getSearchBtn() {
		return searchBtn;
	}

	public void setSearchPnl(JPanel searchPnl) {
		this.searchPnl = searchPnl;
	}

	public JPanel getViewGopalaMithraPanel() {
		return viewGopalaMithraPanel;
	}



}
